home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_span.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  2.8 KB  |  68 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="400" height="190" caption="Word/sentence">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.         </panel>
  6.     </controls>
  7.     <dialogevents>
  8.         <event type="onclose" resulttype="ok">
  9.             StartCode := '<span';
  10.               If edtCSSClass.Text <> '' then
  11.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  12.               If edtCSSId.Text <> '' then
  13.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  14.               If edtCSSStyle.Text <> '' then
  15.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  16.             for i := 0 to EventGrid.Count - 1 do
  17.               begin
  18.               if EventGrid.Rows[i].EditText <> '' then
  19.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  20.              end;  
  21.             StartCode := StartCode + '>'; 
  22.             EndCode := '</span>';
  23.             If cbMakeXHTMLCompliant.Checked then
  24.              StartCode := MakeXHTMLCompliant(StartCode, true);             
  25.             If cbDoPHPEscape.Checked then
  26.              StartCode := DoPHPEscape(StartCode);
  27.             // A little "hack" - WebCoder will set this, to let us know whether to update
  28.             // an existing tag, or insert a brand new one
  29.             If cbUpdateExistingTag.Checked then 
  30.              ReplaceTag(StartCode)
  31.             else 
  32.                InsertTags(StartCode, EndCode);   
  33.               
  34.         </event>
  35.         <event type="onshow">    
  36.             // Lets put the advanced panel in the right place
  37.             pnlAdvanced.Parent := MainPanel;
  38.             pnlAdvanced.Left := 8;
  39.             pnlAdvanced.Top := MainPanel.Height - 32;        
  40.             pnlAdvanced.Width := Self.Width - 36;
  41.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  42.             If pnlAdvanced.Height > 20 then
  43.              Self.Height := Self.Height + 200;
  44.             Self.ActiveControl := MainPanel;
  45.             MainPanel.SetFocus; 
  46.         </event>
  47.         <event type="updatedialog">
  48.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  49.             // The entire selected tag will be passed as a parameter to this function, that should update
  50.             // the required fields of the dialog.
  51.             function UpdateDialog(Tag: string);
  52.              begin
  53.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  54.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  55.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  56.               for i := 0 to EventGrid.Count - 1 do
  57.                 begin
  58.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  59.                  If EventVal <> '' then
  60.                   EventGrid.Rows[i].EditText := EventVal;
  61.                end;      
  62.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  63.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                        
  64.              end;
  65.         </event>
  66.     </dialogevents>
  67. </dialog>
  68.